// OpenGLView.h : interface of the COpenGLView class
//
/////////////////////////////////////////////////////////////////////////////

#if !defined(AFX_OPENGLVIEW_H__996B7B82_E9C5_4279_BA3A_0232EB38BB64__INCLUDED_)
#define AFX_OPENGLVIEW_H__996B7B82_E9C5_4279_BA3A_0232EB38BB64__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "OpenGLExtensions.h"

class COpenGLView : public CView
{
protected: // create from serialization only
	COpenGLView();
	DECLARE_DYNCREATE(COpenGLView)

// Attributes
public:
	CTerrainEditorDoc* GetDocument();

// Operations
public:

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(COpenGLView)
	public:
	virtual void OnDraw(CDC* pDC);  // overridden to draw this view
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
	protected:
	//}}AFX_VIRTUAL

	virtual void VirtualOnCreate();
	virtual void VirtualOnDraw();
	virtual void VirtualOnSize(int width, int height);

// Implementation
public:
	virtual ~COpenGLView();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

// Member variables
private:
	CDC*	m_pCDC;
	HGLRC	m_hRC;
	BOOL	SetupPixelFormat();
	PIXELFORMATDESCRIPTOR m_pfdPixelFormat;
	HCURSOR m_hMouseCursor;

public:
	COpenGLExtensions m_extOpenGL;
	void BeginOpenGLCommands();
	void EndOpenGLCommands();
	bool m_bUsingOpenGLCommands;
	void DrawOpenGLCoordinateSystem();

protected:

// Generated message map functions
protected:
	//{{AFX_MSG(COpenGLView)
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	afx_msg BOOL OnEraseBkgnd(CDC* pDC);
	afx_msg void OnDestroy();
	afx_msg void OnSize(UINT nType, int cx, int cy);
	afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

#ifndef _DEBUG  // debug version in OpenGLView.cpp
inline CTerrainEditorDoc* COpenGLView::GetDocument()
   { return (CTerrainEditorDoc*)m_pDocument; }
#endif

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_OPENGLVIEW_H__996B7B82_E9C5_4279_BA3A_0232EB38BB64__INCLUDED_)
